package cn.wolfcode.wolf2w.query;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/*
游记条件范围类
* 解决出行天数范围查询
* */
public class TravelCondition {

    //旅游天数初始化map映射集合
    public static final Map<Integer, TravelCondition> DAY_MAP = new HashMap<>();
    //游记的人均消费
    public static final Map<Integer, TravelCondition>  PEREXPEND_MAP = new HashMap<>();


    private int min;  //最小值
    private int max;  //最大值
/* 出行天数：

                <select  class="com-opt" name="dayType" @change="conditionChange">
                    <option value="-1">不限</option>
                    <option value="1">3天以下</option>
                    <option value="2">4-7天</option>
                    <option value="3">8-14天</option>
                    <option value="4">15天以上</option>
                </select>

                转化成对象拼接进来
                */
    static {
        DAY_MAP.put(1, new TravelCondition(0, 3));
        DAY_MAP.put(2, new TravelCondition(4, 7));
        DAY_MAP.put(3, new TravelCondition(8, 14));
        DAY_MAP.put(4, new TravelCondition(15, Integer.MAX_VALUE));



        PEREXPEND_MAP.put(1, new TravelCondition(1, 999));
        PEREXPEND_MAP.put(2, new TravelCondition(1000, 6000));
        PEREXPEND_MAP.put(3, new TravelCondition(6001, 20000));
        PEREXPEND_MAP.put(4, new TravelCondition(20001, Integer.MAX_VALUE));
    }
    public TravelCondition(int min, int max){
        this.min = min;
        this.max = max;
    }

    public static Map<Integer, TravelCondition> getDayMap() {
        return DAY_MAP;
    }

    public static Map<Integer, TravelCondition> getPerexpendMap() {
        return PEREXPEND_MAP;
    }

    public int getMin() {
        return min;
    }

    public int getMax() {
        return max;
    }
}
